package com.yanqu.road.server.cmd.zhaoshang;

import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.entity.log.LogZsProjectJoin;
import com.yanqu.road.pb.zhaoshang.ZhaoShangProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.log.AutoLogMgr;
import com.yanqu.road.server.manger.log.LogMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_ZS_SIT_DOWN_FROM_CROSS, desc = "")
public class ZsJoinToServerCmdFromCross extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        ZhaoShangProto.ZsJoinToServerMsg msg = ZhaoShangProto.ZsJoinToServerMsg.parseFrom(packet.getBytes());


        AutoLogMgr.add(new LogZsProjectJoin(player.getUserId(), msg.getProjectId(), msg.getDecorationClass(), player.getTitleId(), msg.getTemplateId(), msg.getOpenUserId(), msg.getSeatId()));

        player.notifyListener(eGamePlayerEventType.ZhaoshangCanyu.getValue(),1);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
